package com.laojiang.mapper;

import com.laojiang.pojo.Score;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScoreMapper {

    // 课程选择
    int courseChange(@Param("student_sno") String student_sno, @Param("course_cno") String course_cno,
                     @Param("teacher_tno") String teacher_tno);

    // 课程取消
    @Delete("DELETE from score where student_sno=#{student_sno} and course_cno=#{course_cno}")
    int courseCancel(@Param("student_sno") String student_sno, @Param("course_cno") String course_cno);

    // 选课查询(判断是否已经选择)
    List<Score> scoresSel(@Param("student_sno") String student_sno, @Param("course_cno") String course_cno);

    // 学生成绩录入
    @Update("UPDATE Score set score=#{score} where student_sno=#{student_sno} and\n" +
            "\tcourse_cno=#{course_cno}")
    int scoresInput(@Param("student_sno") String student_sno, @Param("course_cno") String course_cno,
                    @Param("score") int score);
}
